home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / bcsrce2.zip / UTILMENU.BC < prev    next >
Text File  |  1990-10-17  |  13KB  |  456 lines

  1. ansi
  2. save_screen
  3. ECHO OFF
  4. break on
  5. rem saving starting drive/directory to return to as needed.
  6. GETDRIVE %!d
  7. GETDIR %!p
  8. rem This is not used in this menu. However, if it was:
  9. rem %!d:
  10. rem cd\%!p
  11. rem would be used each time upon changing drives & directories.
  12. Let %!z = L1
  13. :TOP2
  14. rem This is used only when menu has been overwrittened by some other
  15. rem program or full screen write.
  16. cls
  17. GOSUB MENU
  18. :TOP
  19. rem calling the MAKECOM.BAS created screen .COM file.
  20. GOSUB SCREEN
  21. rem ==============================
  22. rem display a clock on screen
  23. HOUR_HOUR
  24. ERROR_LEVEL %!h
  25. let %!w = %!h
  26. lt %!w 10
  27. if errorlevel 1 let %!h = 0%!h
  28. MINUTE_MINUTE
  29. ERROR_LEVEL %!m
  30. let %!w = %!m
  31. lt %!w 10
  32. if errorlevel 1 let %!m = 0%!m
  33. rem the below feature does not give an accurate reading. 'Tis best
  34. rem to not even use it unless attempting a timing algorythm.
  35. REM SECONDS_SECONDS
  36. REM ERROR_LEVEL %!s
  37. rem locate 2 20
  38. rem echonolf  %!h:%!m:%!s 
  39. rem *litebar screen writes
  40. locate 2 21
  41. echonolf  %!h:%!m 
  42. rem ==============================
  43. rem Get the key press then evaluate it.
  44. rem Note the sequence of using the same ERRLEVEL test two or three times
  45. rem with its associated action command. For two tests, it means HOME,
  46. rem END, or F1-F9 was pressed. For three tests, either an uppercase
  47. rem or lower case letter was pressed. The third test branches to the
  48. rem chosen menu choice's batch commands.
  49. getkey
  50. IF ERRLEVEL 20224 Let %!z = L9
  51. IF ERRLEVEL 20224 GOTO TOP
  52. IF ERRLEVEL 19712 GOTO RTL1
  53. IF ERRLEVEL 19200 GOTO LTL1
  54. IF ERRLEVEL 18176 Let %!z = L1
  55. IF ERRLEVEL 18176 GOTO TOP
  56. IF ERRLEVEL 17408 Let %!z = L1
  57. IF ERRLEVEL 17408 GOTO TOP
  58. IF ERRLEVEL 17152 Let %!z = L9
  59. IF ERRLEVEL 17152 GOTO TOP
  60. IF ERRLEVEL 16896 Let %!z = L8
  61. IF ERRLEVEL 16896 GOTO TOP
  62. IF ERRLEVEL 16640 Let %!z = L7
  63. IF ERRLEVEL 16640 GOTO TOP
  64. IF ERRLEVEL 16384 Let %!z = L6
  65. IF ERRLEVEL 16384 GOTO TOP
  66. IF ERRLEVEL 16128 Let %!z = L5
  67. IF ERRLEVEL 16128 GOTO TOP
  68. IF ERRLEVEL 15872 Let %!z = L4
  69. IF ERRLEVEL 15872 GOTO TOP
  70. IF ERRLEVEL 15616 Let %!z = L3
  71. IF ERRLEVEL 15616 GOTO TOP
  72. IF ERRLEVEL 15360 Let %!z = L2
  73. IF ERRLEVEL 15360 GOTO TOP
  74. IF ERRLEVEL 15104 Let %!z = L1
  75. IF ERRLEVEL 15104 GOTO TOP
  76. IF ERRLEVEL 119 Let %!z = L3
  77. IF ERRLEVEL 119 GOSUB SCREEN
  78. IF ERRLEVEL 119 GOTO L3
  79. IF ERRLEVEL 118 Let %!z = L6
  80. IF ERRLEVEL 118 GOSUB SCREEN
  81. IF ERRLEVEL 118 GOTO L6
  82. IF ERRLEVEL 117 Let %!z = L2
  83. IF ERRLEVEL 117 GOSUB SCREEN
  84. IF ERRLEVEL 117 GOTO L2
  85. IF ERRLEVEL 114 Let %!z = L9
  86. IF ERRLEVEL 114 GOSUB SCREEN
  87. IF ERRLEVEL 114 GOTO L9
  88. IF ERRLEVEL 105 Let %!z = L8
  89. IF ERRLEVEL 105 GOSUB SCREEN
  90. IF ERRLEVEL 105 GOTO L8
  91. IF ERRLEVEL 102 Let %!z = L7
  92. IF ERRLEVEL 102 GOSUB SCREEN
  93. IF ERRLEVEL 102 GOTO L7
  94. IF ERRLEVEL 100 Let %!z = L5
  95. IF ERRLEVEL 100 GOSUB SCREEN
  96. IF ERRLEVEL 100 GOTO L5
  97. IF ERRLEVEL 99 Let %!z = L4
  98. IF ERRLEVEL 99 GOSUB SCREEN
  99. IF ERRLEVEL 99 GOTO L4
  100. IF ERRLEVEL 97 Let %!z = L1
  101. IF ERRLEVEL 97 GOSUB SCREEN
  102. IF ERRLEVEL 97 GOTO L1
  103. IF ERRLEVEL 87 Let %!z = L3
  104. IF ERRLEVEL 87 GOSUB SCREEN
  105. IF ERRLEVEL 87 GOTO L3
  106. IF ERRLEVEL 86 Let %!z = L6
  107. IF ERRLEVEL 86 GOSUB SCREEN
  108. IF ERRLEVEL 86 GOTO L6
  109. IF ERRLEVEL 85 Let %!z = L2
  110. IF ERRLEVEL 85 GOSUB SCREEN
  111. IF ERRLEVEL 85 GOTO L2
  112. IF ERRLEVEL 82 Let %!z = L9
  113. IF ERRLEVEL 82 GOSUB SCREEN
  114. IF ERRLEVEL 82 GOTO L9
  115. IF ERRLEVEL 73 Let %!z = L8
  116. IF ERRLEVEL 73 GOSUB SCREEN
  117. IF ERRLEVEL 73 GOTO L8
  118. IF ERRLEVEL 70 Let %!z = L7
  119. IF ERRLEVEL 70 GOSUB SCREEN
  120. IF ERRLEVEL 70 GOTO L7
  121. IF ERRLEVEL 68 Let %!z = L5
  122. IF ERRLEVEL 68 GOSUB SCREEN
  123. IF ERRLEVEL 68 GOTO L5
  124. IF ERRLEVEL 67 Let %!z = L4
  125. IF ERRLEVEL 67 GOSUB SCREEN
  126. IF ERRLEVEL 67 GOTO L4
  127. IF ERRLEVEL 65 Let %!z = L1
  128. IF ERRLEVEL 65 GOSUB SCREEN
  129. IF ERRLEVEL 65 GOTO L1
  130. IF ERRLEVEL 27 GOTO END
  131. IF ERRLEVEL 13 GOTO SELECT
  132. GOTO TOP
  133. :SCREEN
  134. rem The structure of this section is:
  135. rem 1) Place cursor at each menu choice's title in turn.
  136. rem 2) If this is the one the user pointed to, hilite it.
  137. rem 3) Otherwise, overwrite it with no hilite.
  138. rem 4) Place cursor at position for a title's descriptive text line.
  139. rem 5) If its menu choice title is hilited, then show the descriptive
  140. rem    text. If not, do nothing.
  141. rem When recycling this code for a new program, this section takes
  142. rem the most rewriting.
  143. locate 4 2
  144. IF %!z = L1 ECHONOLF √ADDRBOOK
  145. IF NOT %!z = L1 ECHONOLF  ADDRBOOK
  146. locate 6 3
  147. IF %!z = L1 ECHONOLF ADDRess BOOK of Street Talk names (for E-Mail & personal information)      ·
  148. locate 4 12
  149. IF %!z = L2 ECHONOLF √Users
  150. IF NOT %!z = L2 ECHONOLF  Users
  151. locate 6 3
  152. IF %!z = L2 ECHONOLF Users currently logged onto the VINES network                              ·
  153. locate 4 19
  154. IF %!z = L3 ECHONOLF √WHOAMI
  155. IF NOT %!z = L3 ECHONOLF  WHOAMI
  156. locate 6 3
  157. IF %!z = L3 ECHONOLF What is my Street Talk name/What server am I logged onto?                  ·
  158. locate 4 27
  159. IF %!z = L4 ECHONOLF √COPYD
  160. IF NOT %!z = L4 ECHONOLF  COPYD
  161. locate 6 3
  162. IF %!z = L4 ECHONOLF Copy source filespec to target filespec with safeguard builtin             ·
  163. locate 4 34
  164. IF %!z = L5 ECHONOLF √DIR_List
  165. IF NOT %!z = L5 ECHONOLF  DIR_List
  166. locate 6 3
  167. IF %!z = L5 ECHONOLF Input a Filespec to receive information on those files (ex: C:\123\*.WK?)  ·
  168. locate 4 44
  169. IF %!z = L6 ECHONOLF √ViewASCII
  170. IF NOT %!z = L6 ECHONOLF  ViewASCII
  171. locate 6 3
  172. IF %!z = L6 ECHONOLF ASCII Chart of Extended IBM characters 128-thru-255 (can be printed)       ·
  173. locate 4 55
  174. IF %!z = L7 ECHONOLF √Format_A
  175. IF NOT %!z = L7 ECHONOLF  Format_A
  176. locate 6 3
  177. IF %!z = L7 ECHONOLF Format either a 360K or 1.2MB diskette in drive A:                         ·
  178. locate 4 65
  179. IF %!z = L8 ECHONOLF √Ignor
  180. IF NOT %!z = L8 ECHONOLF  Ignor
  181. locate 6 3
  182. IF %!z = L8 ECHONOLF Reserved for later expansion as needed                                     ·
  183. locate 4 72
  184. IF %!z = L9 ECHONOLF √RunDOS
  185. IF NOT %!z = L9 ECHONOLF  RunDOS
  186. locate 6 3
  187. IF %!z = L9 ECHONOLF Run a single DOS command without exiting menu program                      ·
  188. RETURN
  189. :SELECT
  190. rem enter was pressed or one of the first letters of each choice
  191. rem This could be rewrittened as GOTO %!z, but it would be less
  192. rem readable.
  193. IF %!z = L1 GOTO L1
  194. IF %!z = L2 GOTO L2
  195. IF %!z = L3 GOTO L3
  196. IF %!z = L4 GOTO L4
  197. IF %!z = L5 GOTO L5
  198. IF %!z = L6 GOTO L6
  199. IF %!z = L7 GOTO L7
  200. IF %!z = L8 GOTO L8
  201. IF %!z = L9 GOTO L9
  202. GOTO TOP
  203. rem left cursor was pressed, positioning is determined
  204. :LTL1
  205. IF NOT %!z = L1 GOTO LTL2
  206. Let %!z = L9
  207. GOTO TOP
  208. :LTL2
  209. IF NOT %!z = L2 GOTO LTL3
  210. Let %!z = L1
  211. GOTO TOP
  212. :LTL3
  213. IF NOT %!z = L3 GOTO LTL4
  214. Let %!z = L2
  215. GOTO TOP
  216. :LTL4
  217. IF NOT %!z = L4 GOTO LTL5
  218. Let %!z = L3
  219. GOTO TOP
  220. :LTL5
  221. IF NOT %!z = L5 GOTO LTL6
  222. Let %!z = L4
  223. GOTO TOP
  224. :LTL6
  225. IF NOT %!z = L6 GOTO LTL7
  226. Let %!z = L5
  227. GOTO TOP
  228. :LTL7
  229. IF NOT %!z = L7 GOTO LTL8
  230. Let %!z = L6
  231. GOTO TOP
  232. :LTL8
  233. IF NOT %!z = L8 GOTO LTL9
  234. Let %!z = L7
  235. GOTO TOP
  236. :LTL9
  237. IF NOT %!z = L9 GOTO LTL1
  238. Let %!z = L8
  239. GOTO TOP
  240. rem right cursor was pressed, positioning is determined
  241. :RTL1
  242. IF NOT %!z = L1 GOTO RTL2
  243. Let %!z = L2
  244. GOTO TOP
  245. :RTL2
  246. IF NOT %!z = L2 GOTO RTL3
  247. Let %!z = L3
  248. GOTO TOP
  249. :RTL3
  250. IF NOT %!z = L3 GOTO RTL4
  251. Let %!z = L4
  252. GOTO TOP
  253. :RTL4
  254. IF NOT %!z = L4 GOTO RTL5
  255. Let %!z = L5
  256. GOTO TOP
  257. :RTL5
  258. IF NOT %!z = L5 GOTO RTL6
  259. Let %!z = L6
  260. GOTO TOP
  261. :RTL6
  262. IF NOT %!z = L6 GOTO RTL7
  263. Let %!z = L7
  264. GOTO TOP
  265. :RTL7
  266. IF NOT %!z = L7 GOTO RTL8
  267. Let %!z = L8
  268. GOTO TOP
  269. :RTL8
  270. IF NOT %!z = L8 GOTO RTL9
  271. Let %!z = L9
  272. GOTO TOP
  273. :RTL9
  274. IF NOT %!z = L9 GOTO RTL1
  275. Let %!z = L1
  276. GOTO TOP
  277. rem L1-L9 are the commands associated with each menu choice.
  278. rem Suggested continuations are L10-L##. You can choose where to
  279. rem restart the hilited choice from when taken back to the menu
  280. rem by changing the value of %!z variable.
  281. :L1
  282. addrbook
  283. Let %!z = L1
  284. goto TOP2
  285. :L2
  286. cls
  287. echo/
  288. echo/
  289. echo/
  290. users
  291. echo/
  292. echo/
  293. echo.
  294. gosub KLUDGWAT
  295. Let %!z = L2
  296. goto TOP2
  297. :L3
  298. CLS
  299. WHOAMI
  300. ECHO.
  301. ECHO.
  302. WHATZ
  303. echo.
  304. echo.
  305. echo.
  306. gosub KLUDGWAT
  307. Let %!z = L3
  308. goto TOP2
  309. :L4
  310. !COPYD
  311. Let %!z = L4
  312. goto TOP2
  313. :L5
  314. cls
  315. gosub BASICS
  316. rem fits within the info block of BASICS subroutines screen mask.
  317. locate 8 4
  318. echonolf  █  Waitin